<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <p>1</p>
    <p>2</p>
    <p>3</p>
    <p>4</p>

    <script>

        var oPs = document.querySelectorAll('p') ;    // 深复制
        console.log(oPs) ;    // NodeList  4

        var oPs2 = document.getElementsByTagName('p') ;   // 浅复制,共享地址
        console.log(oPs2) ;   // HTMLCollection  4



        setTimeout(function(){
            var oP = document.createElement('p') ;
            oP.innerHTML = 5 ;
            document.body.appendChild(oP) ;

            console.log(oPs) ;   //  4
            console.log(oPs2) ;  // 5
        } , 1000)


    </script>
    
</body>
</html>